#ifndef CLIENTWINDOW_H
#define CLIENTWINDOW_H

#include <QObject>
#include <QWidget>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QToolbar>
#include <QBoxLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QString>
#include <QLabel>
#include <QFileDialog>

#include "../Common/Observer.h"
#include "../Common/Observable.h"

#include "../Common/Song.h"
#include "../Common/Playlist.h"
#include "../Common/PlaylistWidget.h"
#include "playlistclient.h"

class ClientWindow : public QMainWindow, public Observer
{
Q_OBJECT

public:
    ClientWindow (QWidget * parent = 0);
    void notify (Observable * obj, int eventCode);

protected slots:
	// Menu handlers
    void connect ();
    void disconnect ();
	void recordAndUpload ();
	void chooseFileAndUpload ();

	// Playback handlers
    void play ();
	void pause ();
	void stop ();

private:
    PlaylistClient	* client;

    QVBoxLayout		* defaultLayout;

    QVBoxLayout		* connectedLayout;
    PlaylistWidget  * playlistWidget;
	QToolBar		* playbackBar;
	QAction			* playAction;
	QAction			* pauseAction;
	QAction			* stopAction;


    void initMenu ();
    void updateMenu ();

    void initDefaultLayout ();
    void initConnectedLayout ();
    void updateGUI ();
};

#endif
